<?php defined('BASEPATH') OR die('No direct access allowed.');
/**
 * Description of "header"
 *
 * Created on Dec 15, 2010
 * @author Ramon Gutierrez
 * @copyright Bitstop Network Services Inc.
 * @version 0.1
 */
 
	// Delete all temporary files for this user
	if($this->session->userdata('client_id')) {
		@rfr('usr/', $this->session->userdata('client_id') . '/temp*');
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title><?php echo $this->lang->line('app_title'); ?> - <?php echo $title; ?></title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="description" content="Providing highly scalable, user friendly hosted queue management solutions worldwide." />
  <meta name="keywords" content="hosted,queue,system,automated,web-based" />
  <link href="<?php echo site_url($this->session->userdata('account_id') ? 'css/style.css' : 'css/splash.css'); ?>" rel="stylesheet" type="text/css" media="all" />
  <!--[if IE]>
  <style type="text/css">
    #nonheader, #loginbox {
      behavior: url('<?php echo site_url('css/pie.htc'); ?>');
    }
    
    span.inputspan {
      border-width: 0px;
      background-color: transparent;
      background-image: url('<?php echo site_url('images/bg-input.png'); ?>');
      background-position: left center;
      background-repeat: no-repeat;
    }
    
    input.inline {
      overflow: hidden;
    }
  </style>
  <![endif]-->
  <!--[if gte IE 8]>
  <style type="text/css">
    ul#sliding-navigation li.sliding-element a, ul#sliding-navigation li.sliding-element .h3, div.info {
      behavior: url('<?php echo site_url('css/pie.htc'); ?>');
    }
    
    span.inputspan input {
      height: 17px;
      padding-top: 4px;
      margin-right: 2px;
    }
  </style>
  <![endif]-->
  <!--[if lte IE 7]>
  <style type="text/css">
    <?php if(!$this->session->userdata('account_id') && $title != $this->lang->line('title_signup')): ?>
    #ie-cell {
      position: relative;
      float: left;
      top: 50%;
    }

    #content {
      top: -50%;
      position: relative;
    }
    <?php endif; ?>
    
    .row, #nonheader {
      position: relative;
      zoom: 1;
    }
    
    .firstcol, .nextcol {
      display: inline;
    }
    
    span.inputspan {
      padding-top: 2px;
      padding-bottom: 1px;
    }
    
    span.inputspan input {
      height: 15px;
      margin-right: 2px;
    }
    
    a.button-form {
      padding-top: 3px;
    }
  </style>
  <![endif]-->
  <script type="text/javascript" src="<?php echo site_url('js/jquery-1.4.2.min.js'); ?>"></script>
  <script type="text/javascript" src="<?php echo site_url('js/jquery.form.js'); ?>"></script>
  <script type="text/javascript" src="<?php echo site_url('js/sliding_menu.js'); ?>"></script>
  <script type="text/javascript">
  // <![CDATA[
    $(document).ready(function() {
      $.preloadImages = function() {
  	    for(var i = 0; i < arguments.length; i++) {
  	  	  $("<" + "img>").attr("src", arguments[i]);
  	    }
   	  }
  	
  	  $.preloadImages("<?php echo site_url('images/img-bigbutton-hover.png'); ?>", "<?php echo site_url('images/img-button-hover.png'); ?>", "<?php echo site_url('images/img-button-long-hover.png'); ?>");
  	
	  //slide("#sliding-navigation", 2, -25, 150, 2);
	  
	  // Append target to external links
	  $('a').each(function() {
	    if($(this).attr("rel") == "external") {
	      $(this).attr("target", "_blank");
		}
	  }); 
	  
	  // Prevent double submit
	  submitted = false;
	  
	  // Submit by enter key
	  $('form').each(function() {
        $('input').keypress(function(e) {
          // Enter pressed?
          if((e.which == 10 || e.which == 13) && !submitted) {
            $(this).parents('form:first').submit();
			submitted = true;
          }
        });
      });
	  
	  $(".submit").click(function() {
		if(!submitted) {
	      $(this).parents('form:first').submit();
		  submitted = true;
		}
	  });
	  <?php if($this->session->userdata('account_id')): ?>
	  // Resize body element on window resize
	  $(window).resize(function() {
		$("#nonheader").width($(window).width() - 50);
	    $("#body").width($("#nonheader").outerWidth() - $("#nav").width());
	  });
	  
	  $(window).resize();
	  <?php else: ?>
      var loginoptions = {
        target:         "#responselogin",
        success:        showResponseLogin
      };
	  
      $("#loginform").ajaxForm(loginoptions);
      
	  function showResponseLogin(responseText, statusText) {
        if(responseText) {
          $("#responselogin").html(responseText).show();
		  submitted = false;
        } else {
          window.location = "<?php echo site_url(); ?>";
        }
      };
	  <?php endif; ?>
	});
  // ]]>
  </script>
  <?php if($grid): ?>
  <link href="<?php echo site_url('css/flexigrid.css'); ?>" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="<?php echo site_url('js/flexigrid.pack.js'); ?>"></script>
  <script type="text/javascript" src="<?php echo site_url('js/common.js'); ?>"></script>
  <?php endif; ?>
  <?php echo $extras; ?>
</head>
<body>
  <!--[if lte IE 6]>
  <div style="width: 100%; font-size: 0.7em; text-align: left; border: 1px solid #fa4646; background-color: #fabfbf; padding: 4px;">
    <?php echo $this->lang->line('ie6_notice'); ?>
  </div>
  <![endif]-->
  <div id="container">
    <div id="cell">
      <div id="ie-cell">
        <div id="content">
          <div id="header">
            <div id="header-left">
              <img src="<?php echo site_url('images/logo.png'); ?>" alt="" />
            </div>
            <div id="header-right">
              <?php if($this->session->userdata('account_id')): ?>
              <?php else: ?>
              <!--
              <form method="post" action="<?php echo site_url('login'); ?>">
                <div>
                  <?php echo $this->lang->line('login_email'); ?><span class="input" style="background-color: #FFFFFF; margin: 0 4px 0 3px;"><input type="text" name="email" id="email" /></span>
                  <?php echo $this->lang->line('login_password'); ?><span class="input" style="background-color: #FFFFFF; margin: 0 4px 0 3px;"><input type="password" name="password" id="password" /></span>
                  <span class="input" style="background-color: #085478;"><input type="submit" id="signin" value="<?php echo $this->lang->line('login_submit'); ?>" /></span>
                </div>
              </form>
              -->
              <?php endif; ?>
            </div>
          </div>
          <div id="nonheader">
          